const app = require('j7/app');
const event = require('j7/event');
const config = require('j7/config');
const metaFactory = require('./metadata/factory');

event.addListener(event.APP_INITIALIZED_EVENT, async () => {
  await require('./metadata/factory').init();
  await require('./middlewares/factory').init();
  await require('./controllers/factory').init();
  await require('./models/factory').init();
  await require('./services/factory').init();
  app.injectionSession(require('./session'));
  console.log(metaFactory.getWeb3SignConf()['listen_port']);
  app.listen(metaFactory.getWeb3SignConf()['listen_port']);
});
app.init();
